include pkg/pkg.mk

ROOT = $(shell pwd)
LIBS_PATH = $(ROOT)/libs
PKG_PATH = $(ROOT)/pkg
INSTALL_PATH = $(ROOT)/../bin/ohos-third

# sdk path
SYSROOT = $(ROOT)/sdk/sysroot
LLVM = $(ROOT)/sdk/llvm

# compile path
CLANG = $(LLVM)/bin/clang
CLANGXX = $(LLVM)/bin/clang++
AR = $(LLVM)/bin/llvm-ar
AS = $(LLVM)/bin/llvm-as
NM = $(LLVM)/bin/llvm-nm
RANLIB = $(LLVM)/bin/llvm-ranlib
STRIP = $(LLVM)/bin/llvm-strip
OBJDUMP = $(LLVM)/bin/llvm-objdump
LD = $(LLVM)/bin/ld.lld

# cflags
OHOS_CFLAGS = --target=arm-liteos -march=armv7-a --sysroot=$(SYSROOT)
OHOS_INCS += -I$(SYSROOT)/usr/include/arm-liteos
OHOS_INCS += -I$(LLVM)/include
OHOS_LIBS += -L$(SYSROOT)/usr/lib/arm-liteos
OHOS_LIBS += -L$(LLVM)/lib

# ---------- 基本方法 ----------

help:
	@echo "Help:" && \
	echo "  make sys     ## download sysroot and llvm" && \
	echo "  make x264    ## build single lib" && \
	echo "  make all     ## build all libs" && \
	echo "  make install ## install to: $(INSTALL_PATH)"

sys:
	@mkdir -p $(LIBS_PATH) && \
	cd $(ROOT)/sdk && \
	./download.sh

# 只拷贝include和lib目录,且只保留.a文件
install:
	@mkdir -p $(INSTALL_PATH)/lib && \
	cp -r $(LIBS_PATH)/include $(INSTALL_PATH)/ && \
	cp -r $(LIBS_PATH)/lib/*.a $(INSTALL_PATH)/lib && \
	unlink $(INSTALL_PATH)/lib/libpng.a

clean:
	@rm -rf $(LIBS_PATH)/*

# ---------- 编译配置 ----------

# 注意依赖顺序
all: zlib png freetype openssl curl lame vpx x264 rtmp vo-amrwbenc xml2 fontconfig ffmpeg
	@echo "---------- make all complete ----------"

# 生成.so时 --enable-shared 反则 --disable-shared
ffmpeg:
	$(ffmpeg-dpkg) $(PKG_PATH)/$(ffmpeg-pkg).$(ffmpeg-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(ffmpeg-pkg) && \
	export PKG_CONFIG_LIBDIR=$(LIBS_PATH)/lib/pkgconfig/ && \
	./configure \
		--prefix=$(LIBS_PATH) \
		--arch=armv7-a \
		--target-os=linux \
		--disable-asm \
		--disable-programs \
		--disable-avdevice \
		--enable-shared \
		--enable-cross-compile \
		--enable-bsf=h264_mp4toannexb \
		--enable-bsf=aac_adtstoasc \
		--enable-small \
		--enable-gpl \
		--enable-version3 \
		--enable-nonfree \
		--enable-avresample \
		--enable-encoder=libx264 \
		--enable-encoder=libvpx_vp8 \
		--enable-encoder=aac \
		--enable-encoder=wmv2 \
		--enable-encoder=wmav2 \
		--enable-encoder=mjpeg \
		--enable-encoder=png \
		--enable-encoder=libmp3lame \
		--enable-encoder=libvo_amrwbenc \
		--enable-encoder=adpcm_swf \
		--enable-encoder=adpcm_ima_wav \
		--enable-encoder=pcm_s16le \
		--enable-encoder=pcm_mulaw \
		--enable-encoder=pcm_alaw \
		--enable-decoder=amrwb \
		--enable-decoder=h264 \
		--enable-decoder=libvpx_vp8 \
		--enable-decoder=aac \
		--enable-decoder=flv \
		--enable-decoder=mp3 \
		--enable-decoder=wmv3 \
		--enable-decoder=wmav2 \
		--enable-decoder=mjpeg \
		--enable-decoder=gif \
		--enable-decoder=png \
		--enable-decoder=pcm_s16le \
		--enable-decoder=pcm_mulaw \
		--enable-decoder=pcm_alaw \
		--enable-decoder=adpcm_swf \
		--enable-decoder=adpcm_ima_wav \
		--enable-muxer=mov \
		--enable-muxer=mp4 \
		--enable-muxer=asf \
		--enable-muxer=flv \
		--enable-muxer=h264 \
		--enable-muxer=m4v \
		--enable-muxer=mjpeg \
		--enable-muxer=amr \
		--enable-muxer=image2 \
		--enable-muxer=mp3 \
		--enable-muxer=wav \
		--enable-muxer=pcm_mulaw \
		--enable-muxer=mxf \
		--enable-muxer=vc1 \
		--enable-muxer=dnxhd \
		--enable-muxer=webm \
		--enable-muxer=rtsp \
		--enable-muxer=opus \
		--enable-demuxer=amr \
		--enable-demuxer=asf \
		--enable-demuxer=mp3 \
		--enable-demuxer=mov \
		--enable-demuxer=h264 \
		--enable-demuxer=aac \
		--enable-demuxer=flv \
		--enable-demuxer=live_flv \
		--enable-demuxer=wav \
		--enable-demuxer=gif \
		--enable-demuxer=mjpeg \
		--enable-demuxer=mpjpeg \
		--enable-demuxer=image_bmp_pipe \
		--enable-demuxer=image_jpeg_pipe \
		--enable-demuxer=image_jpegls_pipe \
		--enable-demuxer=image_png_pipe \
		--enable-demuxer=webm_dash_manifest \
		--enable-demuxer=dnxhd \
		--enable-demuxer=matroska,webm \
		--enable-demuxer=vc1 \
		--enable-demuxer=rtsp \
		--enable-parser=h264 \
		--enable-parser=aac \
		--enable-parser=mpeg4video \
		--enable-parser=mjpeg \
		--enable-parser=png \
		--enable-parser=bmp \
		--enable-parser=vp8 \
		--enable-avfilter \
		--enable-filter=overlay \
		--enable-filter=scale \
		--enable-filter=movie \
		--enable-filter=colorchannelmixer \
		--enable-filter=drawtext \
		--enable-filter=eq \
		--enable-filter=format \
		--enable-filter=amix \
		--enable-filter=aresample \
		--enable-filter=brchromakey \
		--enable-pic \
		--enable-zlib \
		--enable-libx264 \
		--enable-libfreetype \
		--enable-libvpx \
		--enable-libmp3lame \
		--enable-librtmp \
		--enable-libvo-amrwbenc \
		--enable-libfontconfig \
		--extra-libs="" \
		--pkg-config-flags="--static" \
		--cc=$(CLANG) \
		--ld=$(CLANG) \
		--strip=$(STRIP) \
		--extra-cflags="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib" \
		--extra-ldflags="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib" && \
	sed -i 's%feclearexcept(%//feclearexcept(%' ./libavfilter/vf_drawtext.c && \
	sed -i 's%fetestexcept(%0)){//fetestexcept(%' ./libavfilter/vf_drawtext.c && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(ffmpeg-pkg)

fontconfig:
	$(fontconfig-dpkg) $(PKG_PATH)/$(fontconfig-pkg).$(fontconfig-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(fontconfig-pkg) && \
	export PKG_CONFIG_LIBDIR=$(LIBS_PATH)/lib/pkgconfig/ && \
	./configure \
		-prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-libxml2 \
		--with-pic \
		--disable-docs \
		CC=$(CLANG) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -D__linux__" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	patch -p1 < $(PKG_PATH)/$(fontconfig-pkg).patch && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(fontconfig-pkg)

# 使用clang暂时编译不过
# make buildlib && make buildlib
expat:
	$(expat-dpkg) $(PKG_PATH)/$(expat-pkg).$(expat-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(expat-pkg) && \
	sed -i '/^#undef \x24\x32/a #endif' ./configure && \
	sed -i '/^#undef \x24\x32/a void __aeabi_unwind_cpp_pr0() {}' ./configure && \
	sed -i '/^#undef \x24\x32/a #ifndef __aeabi_unwind_cpp_pr0' ./configure && \
	./configure \
		-prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-static \
		--with-pic \
		CC=$(CLANG) \
		CXX=$(CLANGXX) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" \
		CXXFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(expat-pkg)

xml2:
	$(xml2-dpkg) $(PKG_PATH)/$(xml2-pkg).$(xml2-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(xml2-pkg) && \
	./configure \
		-prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-static \
		--with-python=no \
		--with-sax1 \
		--with-pic \
		CC=$(CLANG) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	sed -i 's%format =%formatLocation =%' ./xmllint.c && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(xml2-pkg)

# 生成.so时 --enable-shared 反则 --enable-shared=no
vo-amrwbenc:
	$(vo-amrwbenc-dpkg) $(PKG_PATH)/$(vo-amrwbenc-pkg).$(vo-amrwbenc-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(vo-amrwbenc-pkg) && \
	./configure \
		-prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-static \
		--enable-shared \
		--with-pic \
		CC=$(CLANG) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(vo-amrwbenc-pkg)

# 不生成.so时添加下面操作
# sed -i 's%SHARED=yes%SHARED=no%' ./Makefile ./librtmp/Makefile && \

rtmp:
	$(rtmp-dpkg) $(PKG_PATH)/$(rtmp-pkg).$(rtmp-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(rtmp-pkg) && \
	sed -i 's%prefix=/usr/local%prefix=$(LIBS_PATH)%' ./Makefile ./librtmp/Makefile && \
	sed -i 's%CC=\x24(CROSS_COMPILE)gcc%CC=$(CLANG)%' ./Makefile ./librtmp/Makefile && \
	sed -i 's%LD=\x24(CROSS_COMPILE)ld%LD=$(LD)%' ./Makefile ./librtmp/Makefile && \
	sed -i 's%AR=\x24(CROSS_COMPILE)ar%AR=$(AR)%' ./Makefile ./librtmp/Makefile && \
	sed -i 's%CFLAGS=%CFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib %' ./Makefile ./librtmp/Makefile && \
	sed -i 's%LDFLAGS=%LDFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib %' ./Makefile && \
	sed -i '/^CFLAGS=/a LDFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib\' ./librtmp/Makefile && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(rtmp-pkg)

lame:
	$(lame-dpkg) $(PKG_PATH)/$(lame-pkg).$(lame-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(lame-pkg) && \
	./configure \
		-prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-static \
		--with-pic \
		CC=$(CLANG) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(lame-pkg)

curl:
	$(curl-dpkg) $(PKG_PATH)/$(curl-pkg).$(curl-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(curl-pkg) && \
	export PKG_CONFIG_LIBDIR=$(LIBS_PATH)/lib/pkgconfig/ && \
	./configure \
		--prefix=$(LIBS_PATH) \
		--host=arm \
		--disable-dict \
        --disable-gopher \
        --disable-ldap \
		--disable-ldaps \
        --disable-manual \
        --disable-pop3 \
		--disable-smtp \
		--disable-imap \
        --disable-rtsp \
        --disable-smb \
        --disable-telnet \
        --disable-verbose \
		--enable-static \
		--with-ssl=$(LIBS_PATH) \
		--with-sysroot=$(SYSROOT) \
		CC=$(CLANG) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		OBJDUMP=$(OBJDUMP) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(curl-pkg)

# 生成.so时添加 shared
openssl:
	$(openssl-dpkg) $(PKG_PATH)/$(openssl-pkg).$(openssl-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(openssl-pkg) && \
	./config \
		--prefix=$(LIBS_PATH) \
		$(OHOS_INCS) \
		$(OHOS_LIBS) \
		shared \
		-no-asm \
		-no-unit-test && \
	sed -i 's%CC= gcc%CC= $(CLANG)%' ./Makefile && \
	sed -i 's%AR= ar%AR= $(AR)%' ./Makefile && \
	sed -i 's%/usr/bin/ranlib%$(RANLIB)%' ./Makefile && \
	sed -i 's%NM= nm%NM= $(NM)%' ./Makefile && \
	sed -i 's%MAKEDEPPROG= gcc%MAKEDEPPROG= $(CLANG)%' ./Makefile && \
	sed -i 's%CFLAG= %CFLAG= $(OHOS_CFLAGS) $(OHOS_INCS) %' ./Makefile && \
	sed -i 's%-m64% %' ./Makefile && \
	make depend && \
	sed -i 's%CFLAG= %CFLAG= $(OHOS_LIBS) %' ./Makefile && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(openssl-pkg)

# 生成.so时 --enable-shared
x264:
	$(x264-dpkg) $(PKG_PATH)/$(x264-pkg).$(x264-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(x264-pkg) && \
	sed -i 's%CC="\x24{CC-\x24{cross_prefix}gcc}"%CC=$(CLANG)%' ./configure && \
	./configure \
		--prefix=$(LIBS_PATH) \
		--host=armv7a-linux \
		--disable-cli \
		--disable-asm \
		--enable-static \
		--enable-shared \
		--extra-cflags="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	sed -i 's%gcc-ar%$(AR)%' ./config.mak && \
	sed -i 's%gcc-ranlib%$(RANLIB)%' ./config.mak && \
	sed -i 's%gcc%$(CLANG)%' ./config.mak && \
	sed -i 's%Wno-maybe-uninitialized%Wno-uninitialized%' ./config.mak && \
	sed -i 's%^CFLAGS=%CFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)%' ./config.mak && \
	sed -i 's%^LDFLAGS=%LDFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)%' ./config.mak && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(x264-pkg)

# 生成.so时 --enable-shared
vpx:
	$(vpx-dpkg) $(PKG_PATH)/$(vpx-pkg).$(vpx-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(vpx-pkg) && \
	./configure \
		--prefix=$(LIBS_PATH) \
		--target=armv7-linux-gcc \
		--disable-webm-io \
		--disable-libyuv \
		--disable-runtime_cpu_detect \
		--disable-neon \
		--disable-neon_asm\
		--disable-tools \
		--disable-examples \
		--disable-debug \
		--disable-debug-libs \
		--disable-install-docs \
		--disable-vp9 \
		--disable-unit-tests \
		--enable-shared \
		--enable-pic \
		--enable-static \
		--enable-install-srcs \
		--enable-install-libs \
		--enable-install-bins && \
	sed -i 's%CC=gcc%CC=$(CLANG)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%CXX=g++%CXX=$(CLANGXX)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%AR=ar%AR=$(AR)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%LD=gcc%LD=$(CLANG)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%AS=as%AS=$(AS)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%STRIP=strip%STRIP=$(STRIP)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%NM=nm%NM=$(NM)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%CFLAGS  =%CFLAGS = $(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%CXXFLAGS  =%CXXFLAGS = $(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)%' ./libs-armv7-linux-gcc.mk && \
	sed -i 's%LDFLAGS =%LDFLAGS = $(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)%' ./libs-armv7-linux-gcc.mk && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(vpx-pkg)

freetype:
	$(freetype-dpkg) $(PKG_PATH)/$(freetype-pkg).$(freetype-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(freetype-pkg) && \
	./configure \
		--prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-static \
		--with-pic \
		--with-zlib=no \
		CC=$(CLANG) \
		LD=$(LD) \
		STRIP=$(STRIP) \
		LIBPNG_CFLAGS="-I$(LIBS_PATH)/include" \
		LIBPNG_LIBS="-L$(LIBS_PATH)/lib -lpng12" && \
	sed -i 's%CFLAGS   :=%CFLAGS   :=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) %' ./builds/unix/unix-cc.mk && \
	sed -i 's%LDFLAGS   :=%LDFLAGS   :=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) %' ./builds/unix/unix-cc.mk && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(freetype-pkg)

# 生成.so时 --enable-shared 反则 --enable-shared=no
png:
	$(png-dpkg) $(PKG_PATH)/$(png-pkg).$(png-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(png-pkg) && \
	./configure \
		-prefix=$(LIBS_PATH) \
		--host=arm \
		--enable-static \
		--enable-shared \
		--with-pic \
		CC=$(CLANG) \
		NM=$(NM) \
		AR=$(AR) \
		AS=$(AS) \
		STRIP=$(STRIP) \
		RANLIB=$(RANLIB) \
		LD=$(LD) \
		CFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -I$(LIBS_PATH)/include -L$(LIBS_PATH)/lib" \
		LDFLAGS="$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS)" && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(png-pkg)

# 生成.so时删去 --static
zlib:
	$(zlib-dpkg) $(PKG_PATH)/$(zlib-pkg).$(zlib-tail) $(LIBS_PATH) && \
	cd $(LIBS_PATH)/$(zlib-pkg) && \
	sed -i '1i\CC=$(CLANG)' ./configure && \
	./configure --prefix=$(LIBS_PATH) && \
	sed -i 's%AR=ar%AR=$(AR)%' ./Makefile && \
	sed -i 's%RANLIB=ranlib%RANLIB=$(RANLIB)%' ./Makefile && \
	sed -i 's%CFLAGS=%CFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) -fPIC %' ./Makefile && \
	sed -i 's%SFLAGS=%SFLAGS=$(OHOS_CFLAGS) $(OHOS_INCS) $(OHOS_LIBS) %' ./Makefile && \
	make -j4 && make install && \
	cd - && \
	rm -rf $(LIBS_PATH)/$(zlib-pkg)
